package main

import (
	"meetroom/server/dynamic"
	"meetroom/server/dynamicFile"
	"meetroom/server/server"
)

func main() {
	server.NewServer()

	//  初始化mysql数据库连接
	db := server.InitDatabase()
	// 初始化redis数据库连接
	rC := server.InitRedis()

	server.AddTemplateFunc(
		"dynamic", dynamic.ToDynamicPath)

	server.AddTemplateFile("templates/page.html")

	// register Mid ware 注册中间件
	server.UseIOCMid(server.JWTVerifyIOC)
	//register Application 注册应用
	server.AddApplication(dynamicFile.DynamicFileApplication())
	server.AddApplication(dynamic.DynamicApplication(db, &rC))
	//启动服务

	server.Build(":8848")
}
